package com.nondo.dean.product.model.result;

import com.nondo.dean.product.domain.Product;
import com.nondo.dean.product.model.result.RelativeResult.ProductBean;

public class RelativeResult {
    private Integer id;// 产品关联ID
    private ProductBean product;// 主产品
    private ProductBean relativeProduct;// 关联产品

    public static class ProductBean {
        private Integer id;// 产品ID
        private String code; // 产品编号
        private String name; // 产品名称

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public ProductBean getProduct() {
        return product;
    }

    public void setProduct(ProductBean product) {
        this.product = product;
    }

    public ProductBean getRelativeProduct() {
        return relativeProduct;
    }

    public void setRelativeProduct(ProductBean relativeProduct) {
        this.relativeProduct = relativeProduct;
    }

    /**
     * 赋值操作
     * @param product2
     * @return
     */
    public static ProductBean covertToBean(Product record) {
        ProductBean productBean = new ProductBean();
        productBean.setId(record.getId());
        productBean.setCode(record.getCode());
        productBean.setName(record.getName());
        return productBean;
    }

}
